package com.tuo51.core.service;

import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.tuo51.core.domain.org.Organization;
import com.tuo51.core.domain.staffs.Staff;
import com.tuo51.foudation.constant.CommonConstant;
import me.chanjar.weixin.mp.bean.result.WxMpUser;

import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2018/5/21
 * *******************************
 */
public interface StaffService {
    Staff getById(String id);

    Staff mpUserByPartnerUserId(String partnerId);

    Staff maUserByPartnerUserId(String partnerId);

    List<Staff> getByPhone(String phone, String appid, Integer platform);

    Staff getOpenIDMP(String openid_mp, String appid);

    Staff getOpenIDMA(String openid_ma, String appid);

    Staff getUnionID(String unionId, String appid);

    Staff add(String openid_ma, String openid_mp, String unionid, String sessionKey, String appid, CommonConstant.Platform platform);

    boolean editStaff(Staff user,
                      String areaName,
                      String address,
                      String realName,
                      String areaCode,
                      String areaCodeDesc,
                      String areaPhone,
                      String phoneNumber);

    Staff updateMaUserInfo(String sessionKey, WxMaUserInfo userInfo, String appid);

    Staff updateMpUserInfo(Staff staff, WxMpUser mpUser);

    Staff updatePhoneNumberInfo(String sessionKey, String phoneNum, String appid);

    Staff updatePhoneNumber(Staff staff, String phoneNum);

    Staff updateSessionKey(Staff staff, String unionId, String sessionKey);

    boolean modifyHeadImg(String staffId, String areaLogo);

    boolean modifyAreaLogo(String staffId, String imgUrl);

    boolean sendSms(String mobile, Integer sourceType);
    boolean isTestMobile(String mobile);

    //检查验证码
    boolean checkSmsCode(String mobile, String code);

    //销毁验证码
    void clearSmsCode(String mobile);

    //用户机构
    Organization staffOrgnization(Staff staff);

    //vip状态查询
    void checkUserVIPStatus(Staff user);

    boolean isYearsVipOrException(Staff staff);

    boolean isYearsVip(Staff staff);

    boolean isTimesVip(Staff staff);

    //迁移所有用户的organization
    int transferAllOrganization();
}
